package com.nxk.modules.content.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nxk.modules.content.entity.ConSwiper;
import com.nxk.modules.content.service.ConSwiperService;
import com.nxk.modules.core.entity.BaseEntity;
import com.nxk.modules.exception.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/web/api/swpier")
public class SwiperApiController {

    @Autowired
    private ConSwiperService conSwiperService;

    @PostMapping("/swiperDetail")
    public ResultEntity swipderDetail(ConSwiper conSwiper){
        QueryWrapper<ConSwiper> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("status", BaseEntity.STATUS_NORMAL);
        queryWrapper.orderByAsc("sort");
        return ResultEntity.success(conSwiperService.list(queryWrapper));
    }


}
